package com.party.mobile.web.annotation;

import com.party.core.model.system.TargetType;

import java.lang.annotation.*;

/**
 * @Description:
 * @Author: yangshoukun
 * @Date: 2018/6/21 10:53
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface VisitCollect {
    // 要统计的是平台还是模块,或者both
    SCOPE[] scope() default {SCOPE.PLATFORM, SCOPE.MODULE};

    // 要统计的内容是什么, 默认pv, uv
    CONTENT[] content() default {CONTENT.PV, CONTENT.UV};

    // 模块
    TargetType module();

    enum SCOPE {
        PLATFORM(1, "PLATFORM"),
        MODULE(2, "MODULE");
        private Integer code;
        private String value;

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        SCOPE(Integer code, String value) {
            this.code = code;
            this.value = value;
        }
    }

    enum CONTENT {
        PV(10, "PV"),
        UV(11, "UV");
        private Integer code;
        private String value;

        public Integer getCode() {
            return code;
        }

        public void setCode(Integer code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        CONTENT(Integer code, String value) {
            this.code = code;
            this.value = value;
        }
    }
}
